﻿@using Kevin.Shop.Business.Service.Entity.Helper
<!doctype html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="~/Themes/RongJi/Style/plugins/bootflat-2.0.3/css/site.min.css">
    <link rel="stylesheet" href="~/Themes/RongJi/Style/base/css/common.css?v=3">
    <link rel="stylesheet" href="~/Themes/Common/assert/plugins/sweetalert-1.0/lib/sweet-alert.css">
    <title>@RenderSection("title", required: false)</title>
    @RenderSection("header", required: false)
    <script src="~/Themes/RongJi/Style/base/js/add2home.js"></script>

</head>
<body>
    <div id="share-wx-guide" style='display: none;'>
        <img src="~/Themes/RongJi/Style/base/imgs/guide.png" alt="">
    </div>
    <div>
        @{
            int mode = 0;
            if (Request.QueryString["mode"] != null)
            {
                Int32.TryParse(Request.QueryString["mode"], out mode);
                //Response.Write(isAppSide);
            }
        }

        <!--Begin Header-->
        <header class="pageHeaderMini">
            @if (Request.QueryString["mode"] != null && mode == 1)//app访问
            {
                  <!-- <img src="~/Themes/RongJi/Style/base/imgs/minitop_bg_no_arrow.png" style="width: 100%; height: auto">-->
            }
            else//网页访问
            {
                <img src="~/Themes/RongJi/Style/base/imgs/minitop_bg.png" style="width: 100%; height: auto">
                <a href="javascript:window.history.go(-1)" class="goback">返回</a>
            }
            <span class="pageTitle">
                @RenderSection("pagetitle", required: false)
            </span>
        </header>
        <!--End Header-->
        @RenderBody()

        <!-- isAppSide为true，表示app端过来的不需要显示footer -->
        @if (Request.QueryString["mode"] == null || (Request.QueryString["mode"] != null && mode != 1))//网页访问
        {
            <!--Begin Footer-->
            <footer>
                <div class="innerwrapper">
                    <div class="footer_bg">
                        <div class="footer_bg_top">
                            <img src="~/Themes/RongJi/Style/base/imgs/footer_bg_top.png">
                        </div>
                        <div class="footer_bg_body">
                            <img src="~/Themes/RongJi/Style/base/imgs/footer_bg.png">
                            <nav>
                                <ul>
                                    <li id="home">
                                        <a href="~/home">
                                            <img id="homeImg" src="~/Themes/RongJi/Style/base/imgs/f1.png" alt="首页">
                                        </a>
                                    </li>
                                    <li id="category">
                                        <a href="~/Sort/Categorylist">
                                            <img id="categoryImg" src="~/Themes/RongJi/Style/base/imgs/f2.png" alt="分类">
                                        </a>
                                    </li>
                                    <li id="myaccount">
                                        <a href="~/myaccount/home">
                                            <img id="myaccountImg" src="~/Themes/RongJi/Style/base/imgs/f3.png" alt="个人中心">
                                        </a>
                                    </li>
                                    <li id="search">
                                        <a href="~/Product/ProductList">
                                            <img id="searchImg" src="~/Themes/RongJi/Style/base/imgs/f4.png" alt="搜索">
                                        </a>
                                    </li>
                                </ul>
                            </nav>
                            <div class="shopcart_icon">
                                <span>购物车</span>
                                <a href="~/Purchase/ShoppingCart">
                                    <div class="cart_badge">
                                        <img src="~/Themes/RongJi/Style/base/imgs/shopcart_empty.png">
                                        <em class="badge"></em>
                                    </div>
                                </a>
                            </div>
                        </div>
                    </div>
                </div>
            </footer>
        }
        <a href="javascript:;" id="goTop">顶部</a>
        <input type="hidden" id="currentUserId" value="@WebClientContext.Current.UserId">
        @if (WebClientContext.Current.UserId > 0)
        {
            <input type="hidden" id="currentUserExpenditure" value="@WebClientContext.Current.CurrentUser.Expenditure">
        }
        <!--End Footer-->
    </div>

    <div class="ui-loader ui-body-a ui-loader-verbose">
        <span class="ui-icon-loading"></span>
        <h1>加载中</h1>
    </div>
    <script type="text/javascript">
        //隐藏底部菜单
        document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
            WeixinJSBridge.call('hideToolbar');
        });
    </script>
    <!--End footer-->
    <!-- JS files.-->
    <script src="~/Themes/RongJi/Style/base/js/jquery-1.10.1.min.js"></script>
    <script src="~/Themes/RongJi/Style/plugins/bootflat-2.0.3/js/bootflat.min.js"></script>

    @*<script src="~/Utility/pages/iscroll.js"></script>
        <script type="text/javascript" src="~/Utility/pages/jquery.cookie.js"></script>*@
    <script src="~/Themes/RongJi/Style/base/js/weixinshare.js"></script>
    <script type="text/javascript" src="~/Utility/pages/pg_common.js" charset="gb2312"></script>
    @*<script type="text/javascript" src="~/Utility/pages/pg_global.js"></script>
        <script src="~/Themes/Common/assert/plugins/sweetalert-1.0/lib/sweet-alert.js" charset="gb2312"></script>*@


    @Scripts.Render("~/bundles/rongji/mobilejs")

    @*weixin share *@
    @if (System.Configuration.ConfigurationManager.AppSettings["WeixinPortalSwitch"] == "true")
    {

        @Html.Action("ConfigScript", "WeixinJsSdk")

    }
    <!-- InstanceBeginEditable name="scriptSection" -->
    <!-- InstanceEndEditable -->
    @RenderSection("footer", required: false)

    <script type="text/javascript">
        $(function () {
            KevinShop.Common.ShoppingCart.RefreshTotalQty();

            var total = KevinShop.Common.ShoppingCart.TotalQty;
            if (total > 0) {
                $(".cart_badge .badge").html(total);
                $('.cart_badge img').attr('src', '/Themes/RongJi/Style/base/imgs/shopcart_full.png');
            }
            else {
                $(".cart_badge .badge").html("");
                $('.cart_badge img').attr('src', '/Themes/RongJi/Style/base/imgs/shopcart_empty.png');
            }

            var _offSet = $('body').offset();
            window.onscroll = function () {
                if (document.body.scrollTop > 300 || document.documentElement.scrollTop > 300) {
                    $('#goTop').fadeIn();
                    $('#goTop').on('click', function () {
                        window.scrollTo(0, 0);
                    })
                }
                else {
                    $('#goTop').fadeOut();
                }
            }

            KevinShop.Common.Loading.hide();
            //$(window).bind('beforeunload', function () {
            //    KevinShop.Common.Loading.show();
            //});
        });
        window.onbeforeunload || (window.onbeforeunload = function () {
            KevinShop.Common.Loading.show();
        });

        function getQueryString(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
            var r = window.location.search.substr(1).match(reg);
            if (r != null) return unescape(r[2]);
            return null;
        }

        //是否已经登录&消费金额
        var currentUserId = $.trim($("#currentUserId").val());
        var currentUserExpenditure = $.trim($("#currentUserExpenditure").val());

        var tpl = '<div class="follow-us"><div><a href="http://mp.weixin.qq.com/s?__biz=MzA5NjI1MzkyMQ==&mid=202756359&idx=1&sn=931a7377dd4fb150edd3c27e9ab55ac0#rd"><img src="/Themes/RongJi/Style/base/imgs/follow-us.jpg" width="100%"></a><span class="close-me"></span></div></div>';
        $('body').append(tpl);
        if ($.cookie("showFollowStatus") == "hide" || getQueryString("v") == "wx" || (currentUserId > 0 && currentUserExpenditure != '' && currentUserExpenditure > 0)) {
            $('.follow-us').addClass('hide');
        }
        else {
            $('.follow-us').removeClass('hide');
        }

        $('.close-me').on('click', function () {
            $('.follow-us').addClass('hide');

            $.cookie("showFollowStatus", "hide", { expires: 360 });
        });

    </script>
    <!--Static Code Start-->
    <script type="text/javascript" src="http://js.tongji.linezing.com/3547905/tongji.js"></script>
    <script src="//meiqia.com/js/mechat.js?unitid=55b060304eae353f18000003" charset="UTF-8" async="async"></script>
    <script type="text/javascript">
        var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
        document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3Fd2c430d3acdc174f29f6feef73ea35fa' type='text/javascript'%3E%3C/script%3E"));
    </script>
    <!-- Piwik -->
    <script type="text/javascript">
        var _paq = _paq || [];
        _paq.push(['trackPageView']);
        _paq.push(['enableLinkTracking']);
        (function () {
            var u = "//analytics.it-hsmedia.com/";
            _paq.push(['setTrackerUrl', u + 'piwik.php']);
            _paq.push(['setSiteId', 1]);
            var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0];
            g.type = 'text/javascript'; g.async = true; g.defer = true; g.src = u + 'piwik.js'; s.parentNode.insertBefore(g, s);
        })();
    </script>
    <noscript><p><img src="//analytics.it-hsmedia.com/piwik.php?idsite=1" style="border:0;height:0" alt="" /></p></noscript>
    <!-- End Piwik Code -->
    <!--Static Code End-->


</body>
<!-- InstanceEnd -->
</html>